'''
set() 可变集合
frozenset() 不可变集合
'''



# set()
data_01 = "aaabbbbbbbbbbccccccccc"
new_data_01= set(data_01)
print(type(new_data_01),new_data_01)

# frozenset()
data_02 =[ "nginx","tomcat","git" "nginx","tomcat","git" "nginx","tomcat"]
new_data_02 =frozenset(data_02)
print (new_data_02)
print (type(new_data_02))

# 通过for循环遍历集合
for i in new_data_02:
    print("---> %s" % i)

# 示例一
data01 = "aaaaaaaabbbbbbbbbddddcccc"

for i in set(data01):
    print("字符：%s, 次数： %d" %(i, data01.count(i)))


